package 日记本;

import javax.swing.text.AbstractDocument;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DiaryContent {
    private String name;
    private String weather;
    private String title;
    private String content;
    LocalDateTime currentTime = LocalDateTime.now();//获取当前时间
    DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    private String time = currentTime.format(dtf);

    public DiaryContent(String name, String weather, String title, String content) {
        this.name = name;
        this.weather = weather;
        this.title = title;
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public String getWeather() {
        return weather;
    }

    public String getTitle() {
        return title;
    }

    public String getContent() {
        return content;
    }

    public String getTime() {
        return time;
    }
}
